package com.travel.mapper.content;

import com.travel.model.entity.content.GuideTag;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
// 指南标签mapper 查询指南标签 插入指南标签 
@Mapper
@Repository("guideTagMapperMyBatis")
public interface GuideTagMapper {
    
    @Select("SELECT * FROM guide_tags WHERE guide_id = #{guideId}")
    List<GuideTag> findByGuideId(@Param("guideId") Long guideId);
    
    @Insert("INSERT INTO guide_tags (guide_id, tag_name) VALUES (#{guideId}, #{tagName})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void save(GuideTag guideTag);
    
    @Delete("DELETE FROM guide_tags WHERE guide_id = #{guideId}")
    int deleteByGuideId(@Param("guideId") Long guideId);
} 